package br.poli.ecomp.tcc.stimultimidia.control.command
{
	import br.poli.ecomp.tcc.stimultimidia.ApplicationFacade;
	import br.poli.ecomp.tcc.stimultimidia.model.*;
	import br.poli.ecomp.tcc.stimultimidia.notification.TelaNotification;
	import br.poli.ecomp.tcc.stimultimidia.view.*;
	import br.poli.ecomp.tcc.stimultimidia.view.components.*;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class StartUpCommand extends SimpleCommand implements ICommand
	{
		
		override public function execute(notification:INotification):void
		{
			 
			var usuarioVOProxy:UsuarioVOProxy = new UsuarioVOProxy() ;
			facade.registerProxy( usuarioVOProxy );
			
			var telaVOProxy:TelaVOProxy = new TelaVOProxy() ;
			facade.registerProxy( telaVOProxy );
			
			var fachadaRemoteProxy:FachadaRemoteProxy = new FachadaRemoteProxy() ;
			facade.registerProxy( fachadaRemoteProxy );


			var app:STIAS3 = notification.getBody() as STIAS3;

			facade.registerMediator( new AppMediator( app ) );
			facade.registerMediator( new TelaCadastroMediator ( app.cadastro ) );
			facade.registerMediator( new TelaLoginMediator( app.login ) );
			facade.registerMediator( new TelaPrincipalMediator( app.main )   );
			
			 		
			// Send first Notification here...
			sendNotification(TelaNotification.ABRIR_TELA_LOGIN);
		
		}
		
	}
}